/**
 * 
 */
package sg.edu.nus.iss.vmcs.payment;

import sg.edu.nus.iss.vmcs.util.Log;

/**
 * @author moe
 * 
 */
public class NetsInterfaceGateway {
	private NetsPayment ctrl = null;

	public NetsInterfaceGateway(NetsPayment ctrl) {
		this.ctrl = ctrl;
	}

	public Boolean checkCard(NetsCardInfo info) {
		Log.LogIt("NetsInterfaceGateway.checkCard:" + info.getInfo());
		NetsUI netsUi = ctrl.getPaymentController().getPanel().getNetsUI();
		Boolean success = netsUi.isValidCard();			
		return success;
	}

	public Boolean deductMoney(int amountToCollect) {
		Log.LogIt("NetsInterfaceGateway.deductMoney:" + amountToCollect);
		NetsUI netsUi = ctrl.getPaymentController().getPanel().getNetsUI();
		Boolean success = netsUi.isPaymentAccepted();
		Log.LogIt("NetsInterfaceGateway.deductMoney:" + amountToCollect + ". " + success);

		return success;
	}

	public void acceptPayment() {
		// TODO Auto-generated method stub

	}

	public void rejectPayment() {
		// TODO Auto-generated method stub

	}
}
